package com.triones.framework.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * 验证状态
 *
 * @author triones
 * 2023-09-19
 */
@Getter
@AllArgsConstructor
public enum MemberAuthEnum {
    /**
     * 待申请 默认状态
     */
    WAIT_APPLY("待申请", "WAIT_APPLY"),
    /**
     * 待审核
     */
    WAIT_AUDIT("待审核", "WAIT_AUDIT"),
    /**
     * 通过
     */
    PASS("通过", "PASS"),
    /**
     * 驳回
     */
    REFUSE("驳回", "REFUSE");

    private String info;
    private String code;

    public static MemberAuthEnum convert(String code) {
        return Stream.of(values()).filter(o -> o.getCode().equalsIgnoreCase(code)).findFirst().orElse(WAIT_APPLY);
    }

}
